<?php
/**
 * 汽车品牌
 * Created by PhpStorm.
 * User: andy
 * Date: 2019/11/19
 * Time: 下午6:42
 */
namespace app\common\model;

use think\Model;

class CarLicenseMoreModel extends Model
{
    protected $pk = "id";

    /**
     * 删除
     * @param $id
     * @return array
     */
    public function del($id){

        $au=self::get($id);
        $au->status=self::DEL_STATUS;

        $status=$au->save();
        if($status){
            return ['status'=>1,'msg'=>'删除成功！'];
        }else{
            return ['status'=>0,'msg'=>'删除失败！'];
        }
    }

    /**
     * 增加
     * @param $data
     * @return array
     * @throws \think\exception\DbException
     */
    public static function adds($data){

        $status = self::insertGetId($data);

        if($status){
            return['status'=>1,'msg'=>'增加成功！'];
        }else{
            return['status'=>0,'msg'=>'增加失败！'];
        }

    }

} 